package org.ucas.faker.web.fetcher.meta;

import org.ucas.faker.web.fetcher.FetchRequest;
import org.ucas.faker.web.fetcher.meta.Table;

import java.io.Serializable;

public class RequestTable extends Table  implements Serializable {

  public FetchRequest request;

  public RequestTable(String name, FetchRequest request) {
    this.name = name;
    this.request = request;
  }

  @Override
  public String sql() {
    if(request == null) return "";

    return "( " + request.sql() + ") AS " + name;
  }
}
